//6:输入一个整数，判断是否是质数（定义是只能被1和自身整除的数，比如3，7，2等）ok
package ZUOYE0421;

import java.util.Scanner;

public class 作业六 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入一个数：");
		int num = in.nextInt();
		boolean c = true;
		for (int a = 1; (a < num - 1);) {
			a++;
			if (num % a == 0) {
				c = false;
				break;
			}
		}
		if (c == false) {
			System.out.println("该不为质数");
		} else {
			System.out.println("该为质数");
		}
	}

}
